﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GD.ModelContest.Model;
using GD.ModelContest.Service;
using GD.ModelContest.Common;

namespace GD.ModelContest.Web.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void lkbLogin_Click(object sender, EventArgs e)
        {
            string userName = this.txtLoginName.Text.Trim();
            string passWord = this.txtPassWord.Text.Trim();
            mc_admin admin = ServiceLocator.IAdminService.GetAdminByLogin(userName, passWord);
            if (admin != null)
            {
                Session["AdminId"] = admin.adminId;
                Response.Redirect("Index.aspx");
            }
            else
            {
                JavaScript.Alert("您输入的用户名或密码有错误！请重试！", this.Page);
                return;
            }
        }
    }
}
